Skip to content

feat(textures): configurable texture offset + setTextureOptions#253

Merged
marco-ponds merged 1 commit into
masterfrom
feat/texture-repeat-offset
Jun 29, 2026
Merged

feat(textures): configurable texture offset + setTextureOptions#253
marco-ponds merged 1 commit into
masterfrom
feat/texture-repeat-offset

Conversation

@marco-ponds

@marco-ponds marco-ponds commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

What

Adds support for a texture's offset and a way to update an assigned texture's tiling options without reloading it.

  • Element.setTexture now reads offset from options, applies it (texture.offset.set(...)), and records it alongside repeat/wrap — so it serializes into EntityConfiguration and round-trips through save/reload and game builds, exactly like repeat already did.
  • New Element.setTextureOptions(type, options) merges new options (e.g. { repeat } or { offset }) into the texture's recorded options and re-applies them to the material — no texture reload.

Why

repeat was already applied/persisted but offset was silently ignored (never recorded, never applied). The editor needs a lightweight way to tweak repeat/offset on an already-assigned texture; setTextureOptions provides that.

Testing

  • npm test → 505/505 pass (29 suites).
  • npm run builddist/mage.js builds clean.
  • Verified end-to-end against the editor PR below (live repeat/offset edits apply in-viewport and persist on reload).

Companion PR

Editor wiring: MageStudio/mage-studio#297

🤖 Generated with Claude Code

Apply and persist Texture.offset alongside the existing repeat handling
in Element.setTexture, so offset round-trips through serialization and
game builds the same way repeat does.

Add Element.setTextureOptions(type, options) to update an already-assigned
texture's repeat/offset by merging into its recorded options and
re-applying, without reloading the texture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@marco-ponds marco-ponds merged commit 5685b69 into master Jun 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant